﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Model.PeerReviewBeenVoter
<!DOCTYPE html>
@Html.Partial("LoadPanelPartial")
<html>
<head>
      @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <link href="@Url.Content("~/Scripts/dynatree/skin/ui.dynatree.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/dynatree/jquery.dynatree.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
    
    @Html.DevExpress().GetStyleSheets(

                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    @Html.DevExpress().GetScripts(
                    new Script { ExtensionType = ExtensionType.ListBox }
    )
     <style type="text/css">
        #tree ul.dynatree-container
        {
            overflow: auto;
            position: relative;
            height: 90%;
        }
        #treeDiv
        {
            overflow: auto;
            position: relative;
            height: 465px;
        }
        body
        {
            margin: 0px;
            font-size: 12px;
        }
    </style>
     <script type="text/javascript">
         $(document).ready(function () {
             $("#toolMenu").smartFloat();
             $("#tabs").tabs();

             //页面加载
             var tableJsonStr = $("#hdtableJsonStr").val();
             var tableStr = "";
             var deptNo = "";
             tableStr += "<table width='100%'>";
             if (tableJsonStr != "") {
                 var tableJsonStrModel = JSON.parse(tableJsonStr);
                 for (var i = 0; i < tableJsonStrModel.length; i++) {
                     if (deptNo != tableJsonStrModel[i]["FDeptNo"]) {
                         deptNo = tableJsonStrModel[i]["FDeptNo"];
                         tableStr += "<tr height='20'><td>" + tableJsonStrModel[i]["FDeptName"] + ":&nbsp;&nbsp;";
                         tableStr += "&nbsp;&nbsp;&nbsp;" + tableJsonStrModel[i]["FEmpName"];
                     } else {
                         tableStr += "&nbsp;&nbsp;&nbsp;" + tableJsonStrModel[i]["FEmpName"];
                     }
                 }
                 tableStr += "</td></tr>";
             }
             tableStr += "</table>";
             $("#orgUserTree").append(tableStr);

         });

         function MenuTop_emClick(source, e) {
             switch (e.item.name) {
                 case "btnAdd":
                     {
                         //增加
                         var peerReviewID = $("#hdpeerReviewID").val();
                         AddDeptEmpl(peerReviewID);
                         break;
                     }
             }
         }

         function AddDeptEmpl(peerReviewID) {
             var obj = new Object();
             var treeModelList = $("#hdtableJsonStr").val();
             if (treeModelList == null) {
                 obj.Value = "";
             }
             else {
                 obj.Value = treeModelList;
             }
             var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/PeerReviewVoterChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
             if (typeof (returnValue) != "undefined") {
                 $.ajax({
                     type: "POST",
                     url: rootPath + "/Admin/PeerReviewVoter/GetTableJsonStr",
                     data: { returnValue: returnValue, peerReviewID: peerReviewID },
                     success: function (result) {
                         if (result != "") {
                             window.location.reload();
                         }
                     }
                 });
             }
         }

    </script>
</head>
<body>
    @if (ViewData["visible"].ToString() == "false")
    {
   <div class="floatToolMenu" id="toolMenu">
        @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnAdd";
               item.Text = "编辑";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");

           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
    </div>
    }
    <div>
      <table border="1" width="100%" class="tableForm">
          <tr height="30">
            <td width="15%" height="25" align="right" class="tdClass" style="padding-right:5px;font-size:13px;padding-left:10px;">
            评议主题:
            </td>
            <td width="85%" align="left" class="tdClass" style="padding-left:5px;padding-right:5px">
                   @Html.DevExpress().ComboBox(settings =>
              {
                  settings.Name = "FBeenVoterClsNo";
                  settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                  settings.Enabled = true;
                  settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
                  settings.Properties.TextField = "FTitle";
                  settings.Properties.ValueField = "FPeerReviewID";
              }).BindList(ViewData["list"]).Bind(ViewData["FBeenVoterClsName"]).GetHtml()
              @Html.Hidden("hdpeerReviewID", ViewData["peerReviewID"])
            </td>           
        </tr>
    </table>
    </div>
    <div id="tabs" class="div">
        <ul>
            <li>评议人定义</li>   
        </ul>
        <div id="orgUserTree">

        </div> 
    </div>
  @Html.Hidden("hdtableJsonStr", ViewData["tableJsonStr"])  
                                            
     <script type="text/javascript">
         lp.Hide();
    </script>
</body>
</html>

